<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1987-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation.  A copy of
the license is included in the
section entitled "GNU Free Documentation License".

This manual contains no Invariant Sections.  The Front-Cover Texts are
(a) (see below), and the Back-Cover Texts are (b) (see below).

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Environment Variables (The C Preprocessor)</title>

<meta name="description" content="Environment Variables (The C Preprocessor)">
<meta name="keywords" content="Environment Variables (The C Preprocessor)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Index-of-Directives.html" rel="index" title="Index of Directives">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html" rel="up" title="Top">
<link href="GNU-Free-Documentation-License.html" rel="next" title="GNU Free Documentation License">
<link href="Invocation.html" rel="prev" title="Invocation">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en">
<div class="chapter-level-extent" id="Environment-Variables">
<div class="nav-panel">
<p>
Next: <a href="GNU-Free-Documentation-License.html" accesskey="n" rel="next">GNU Free Documentation License</a>, Previous: <a href="Invocation.html" accesskey="p" rel="prev">Invocation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index-of-Directives.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h2 class="chapter" id="Environment-Variables-1"><span>13 Environment Variables<a class="copiable-link" href="#Environment-Variables-1"> &para;</a></span></h2>
<a class="index-entry-id" id="index-environment-variables"></a>

<p>This section describes the environment variables that affect how CPP
operates.  You can use them to specify directories or prefixes to use
when searching for include files, or to control dependency output.
</p>
<p>Note that you can also specify places to search using options such as
<samp class="option">-I</samp>, and control dependency output with options like
<samp class="option">-M</samp> (see <a class="pxref" href="Invocation.html">Invocation</a>).  These take precedence over
environment variables, which in turn take precedence over the
configuration of GCC.
</p>



<dl class="vtable">
<dt><a id="index-CPATH"></a><span><code class="env">CPATH</code><a class="copiable-link" href="#index-CPATH"> &para;</a></span></dt>
<dt><a id="index-C_005fINCLUDE_005fPATH"></a><span><code class="env">C_INCLUDE_PATH</code><a class="copiable-link" href="#index-C_005fINCLUDE_005fPATH"> &para;</a></span></dt>
<dt><a id="index-CPLUS_005fINCLUDE_005fPATH"></a><span><code class="env">CPLUS_INCLUDE_PATH</code><a class="copiable-link" href="#index-CPLUS_005fINCLUDE_005fPATH"> &para;</a></span></dt>
<dt><a id="index-OBJC_005fINCLUDE_005fPATH"></a><span><code class="env">OBJC_INCLUDE_PATH</code><a class="copiable-link" href="#index-OBJC_005fINCLUDE_005fPATH"> &para;</a></span></dt>
<dd><p>Each variable&rsquo;s value is a list of directories separated by a special
character, much like <code class="env">PATH</code>, in which to look for header files.
The special character, <code class="code">PATH_SEPARATOR</code>, is target-dependent and
determined at GCC build time.  For Microsoft Windows-based targets it is a
semicolon, and for almost all other targets it is a colon.
</p>
<p><code class="env">CPATH</code> specifies a list of directories to be searched as if
specified with <samp class="option">-I</samp>, but after any paths given with <samp class="option">-I</samp>
options on the command line.  This environment variable is used
regardless of which language is being preprocessed.
</p>
<p>The remaining environment variables apply only when preprocessing the
particular language indicated.  Each specifies a list of directories
to be searched as if specified with <samp class="option">-isystem</samp>, but after any
paths given with <samp class="option">-isystem</samp> options on the command line.
</p>
<p>In all these variables, an empty element instructs the compiler to
search its current working directory.  Empty elements can appear at the
beginning or end of a path.  For instance, if the value of
<code class="env">CPATH</code> is <code class="code">:/special/include</code>, that has the same
effect as &lsquo;<samp class="samp">-I.&nbsp;-I/special/include<!-- /@w --></samp>&rsquo;.
</p>
<p>See also <a class="ref" href="Search-Path.html">Search Path</a>.
</p>
</dd>
<dt><a class="index-entry-id" id="index-dependencies-for-make-as-output"></a>
<a id="index-DEPENDENCIES_005fOUTPUT"></a><span><code class="env">DEPENDENCIES_OUTPUT</code><a class="copiable-link" href="#index-DEPENDENCIES_005fOUTPUT"> &para;</a></span></dt>
<dd><p>If this variable is set, its value specifies how to output
dependencies for Make based on the non-system header files processed
by the compiler.  System header files are ignored in the dependency
output.
</p>
<p>The value of <code class="env">DEPENDENCIES_OUTPUT</code> can be just a file name, in
which case the Make rules are written to that file, guessing the target
name from the source file name.  Or the value can have the form
&lsquo;<samp class="samp"><var class="var">file</var> <var class="var">target</var></samp>&rsquo;, in which case the rules are written to
file <var class="var">file</var> using <var class="var">target</var> as the target name.
</p>
<p>In other words, this environment variable is equivalent to combining
the options <samp class="option">-MM</samp> and <samp class="option">-MF</samp>
(see <a class="pxref" href="Invocation.html">Invocation</a>),
with an optional <samp class="option">-MT</samp> switch too.
</p>
</dd>
<dt><a class="index-entry-id" id="index-dependencies-for-make-as-output-1"></a>
<a id="index-SUNPRO_005fDEPENDENCIES"></a><span><code class="env">SUNPRO_DEPENDENCIES</code><a class="copiable-link" href="#index-SUNPRO_005fDEPENDENCIES"> &para;</a></span></dt>
<dd><p>This variable is the same as <code class="env">DEPENDENCIES_OUTPUT</code> (see above),
except that system header files are not ignored, so it implies
<samp class="option">-M</samp> rather than <samp class="option">-MM</samp>.  However, the dependence on the
main input file is omitted.
See <a class="xref" href="Invocation.html">Invocation</a>.
</p>
</dd>
<dt><a id="index-SOURCE_005fDATE_005fEPOCH"></a><span><code class="env">SOURCE_DATE_EPOCH</code><a class="copiable-link" href="#index-SOURCE_005fDATE_005fEPOCH"> &para;</a></span></dt>
<dd><p>If this variable is set, its value specifies a UNIX timestamp to be
used in replacement of the current date and time in the <code class="code">__DATE__</code>
and <code class="code">__TIME__</code> macros, so that the embedded timestamps become
reproducible.
</p>
<p>The value of <code class="env">SOURCE_DATE_EPOCH</code> must be a UNIX timestamp,
defined as the number of seconds (excluding leap seconds) since
01 Jan 1970 00:00:00 represented in ASCII; identical to the output of
<code class="code">date +%s</code> on GNU/Linux and other systems that support the
<code class="code">%s</code> extension in the <code class="code">date</code> command.
</p>
<p>The value should be a known timestamp such as the last modification
time of the source or package and it should be set by the build
process.
</p>
</dd>
</dl>

</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="GNU-Free-Documentation-License.html">GNU Free Documentation License</a>, Previous: <a href="Invocation.html">Invocation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index-of-Directives.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
